module SelectUnit(
  input   io_r,
  output  io_eo,
  input   io_wi,
  output  io_g
);
  wire  _T_2 = |io_wi; // @[roundRobin.scala 143:43]
  wire  _T_3 = ~_T_2; // @[roundRobin.scala 143:24]
  wire  g_0 = io_r & _T_3; // @[roundRobin.scala 143:22]
  assign io_eo = g_0 | io_wi; // @[roundRobin.scala 156:9]
  assign io_g = io_r & _T_3; // @[roundRobin.scala 155:8]
endmodule
module StrictPriority(
  input  [14:0] io_r_0_0,
  output [14:0] io_g_0_0
);
  wire  units_0_0_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_0_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_0_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_0_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_1_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_1_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_1_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_1_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_2_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_2_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_2_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_2_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_3_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_3_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_3_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_3_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_4_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_4_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_4_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_4_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_5_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_5_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_5_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_5_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_6_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_6_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_6_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_6_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_7_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_7_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_7_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_7_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_8_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_8_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_8_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_8_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_9_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_9_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_9_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_9_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_10_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_10_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_10_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_10_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_11_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_11_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_11_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_11_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_12_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_12_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_12_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_12_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_13_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_13_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_13_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_13_io_g; // @[roundRobin.scala 201:83]
  wire  units_0_14_io_r; // @[roundRobin.scala 201:83]
  wire  units_0_14_io_eo; // @[roundRobin.scala 201:83]
  wire  units_0_14_io_wi; // @[roundRobin.scala 201:83]
  wire  units_0_14_io_g; // @[roundRobin.scala 201:83]
  wire  _T_3 = units_0_14_io_g; // @[roundRobin.scala 231:75]
  wire  _T_4 = units_0_13_io_g; // @[roundRobin.scala 231:75]
  wire  _T_5 = units_0_12_io_g; // @[roundRobin.scala 231:75]
  wire  _T_6 = units_0_11_io_g; // @[roundRobin.scala 231:75]
  wire  _T_7 = units_0_10_io_g; // @[roundRobin.scala 231:75]
  wire  _T_8 = units_0_9_io_g; // @[roundRobin.scala 231:75]
  wire  _T_9 = units_0_8_io_g; // @[roundRobin.scala 231:75]
  wire  _T_10 = units_0_7_io_g; // @[roundRobin.scala 231:75]
  wire  _T_11 = units_0_6_io_g; // @[roundRobin.scala 231:75]
  wire  _T_12 = units_0_5_io_g; // @[roundRobin.scala 231:75]
  wire  _T_13 = units_0_4_io_g; // @[roundRobin.scala 231:75]
  wire  _T_14 = units_0_3_io_g; // @[roundRobin.scala 231:75]
  wire  _T_15 = units_0_2_io_g; // @[roundRobin.scala 231:75]
  wire  _T_16 = units_0_1_io_g; // @[roundRobin.scala 231:75]
  wire  _T_17 = units_0_0_io_g; // @[roundRobin.scala 231:75]
  wire [6:0] _T_23 = {_T_11,_T_12,_T_13,_T_14,_T_15,_T_16,_T_17}; // @[Cat.scala 29:58]
  wire [7:0] _T_30 = {_T_3,_T_4,_T_5,_T_6,_T_7,_T_8,_T_9,_T_10}; // @[Cat.scala 29:58]
  SelectUnit units_0_0 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_0_io_r),
    .io_eo(units_0_0_io_eo),
    .io_wi(units_0_0_io_wi),
    .io_g(units_0_0_io_g)
  );
  SelectUnit units_0_1 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_1_io_r),
    .io_eo(units_0_1_io_eo),
    .io_wi(units_0_1_io_wi),
    .io_g(units_0_1_io_g)
  );
  SelectUnit units_0_2 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_2_io_r),
    .io_eo(units_0_2_io_eo),
    .io_wi(units_0_2_io_wi),
    .io_g(units_0_2_io_g)
  );
  SelectUnit units_0_3 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_3_io_r),
    .io_eo(units_0_3_io_eo),
    .io_wi(units_0_3_io_wi),
    .io_g(units_0_3_io_g)
  );
  SelectUnit units_0_4 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_4_io_r),
    .io_eo(units_0_4_io_eo),
    .io_wi(units_0_4_io_wi),
    .io_g(units_0_4_io_g)
  );
  SelectUnit units_0_5 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_5_io_r),
    .io_eo(units_0_5_io_eo),
    .io_wi(units_0_5_io_wi),
    .io_g(units_0_5_io_g)
  );
  SelectUnit units_0_6 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_6_io_r),
    .io_eo(units_0_6_io_eo),
    .io_wi(units_0_6_io_wi),
    .io_g(units_0_6_io_g)
  );
  SelectUnit units_0_7 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_7_io_r),
    .io_eo(units_0_7_io_eo),
    .io_wi(units_0_7_io_wi),
    .io_g(units_0_7_io_g)
  );
  SelectUnit units_0_8 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_8_io_r),
    .io_eo(units_0_8_io_eo),
    .io_wi(units_0_8_io_wi),
    .io_g(units_0_8_io_g)
  );
  SelectUnit units_0_9 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_9_io_r),
    .io_eo(units_0_9_io_eo),
    .io_wi(units_0_9_io_wi),
    .io_g(units_0_9_io_g)
  );
  SelectUnit units_0_10 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_10_io_r),
    .io_eo(units_0_10_io_eo),
    .io_wi(units_0_10_io_wi),
    .io_g(units_0_10_io_g)
  );
  SelectUnit units_0_11 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_11_io_r),
    .io_eo(units_0_11_io_eo),
    .io_wi(units_0_11_io_wi),
    .io_g(units_0_11_io_g)
  );
  SelectUnit units_0_12 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_12_io_r),
    .io_eo(units_0_12_io_eo),
    .io_wi(units_0_12_io_wi),
    .io_g(units_0_12_io_g)
  );
  SelectUnit units_0_13 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_13_io_r),
    .io_eo(units_0_13_io_eo),
    .io_wi(units_0_13_io_wi),
    .io_g(units_0_13_io_g)
  );
  SelectUnit units_0_14 ( // @[roundRobin.scala 201:83]
    .io_r(units_0_14_io_r),
    .io_eo(units_0_14_io_eo),
    .io_wi(units_0_14_io_wi),
    .io_g(units_0_14_io_g)
  );
  assign io_g_0_0 = {_T_30,_T_23}; // @[roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18 roundRobin.scala 231:18]
  assign units_0_0_io_r = io_r_0_0[0]; // @[roundRobin.scala 229:22]
  assign units_0_0_io_wi = 1'h0; // @[roundRobin.scala 212:25]
  assign units_0_1_io_r = io_r_0_0[1]; // @[roundRobin.scala 229:22]
  assign units_0_1_io_wi = units_0_0_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_2_io_r = io_r_0_0[2]; // @[roundRobin.scala 229:22]
  assign units_0_2_io_wi = units_0_1_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_3_io_r = io_r_0_0[3]; // @[roundRobin.scala 229:22]
  assign units_0_3_io_wi = units_0_2_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_4_io_r = io_r_0_0[4]; // @[roundRobin.scala 229:22]
  assign units_0_4_io_wi = units_0_3_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_5_io_r = io_r_0_0[5]; // @[roundRobin.scala 229:22]
  assign units_0_5_io_wi = units_0_4_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_6_io_r = io_r_0_0[6]; // @[roundRobin.scala 229:22]
  assign units_0_6_io_wi = units_0_5_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_7_io_r = io_r_0_0[7]; // @[roundRobin.scala 229:22]
  assign units_0_7_io_wi = units_0_6_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_8_io_r = io_r_0_0[8]; // @[roundRobin.scala 229:22]
  assign units_0_8_io_wi = units_0_7_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_9_io_r = io_r_0_0[9]; // @[roundRobin.scala 229:22]
  assign units_0_9_io_wi = units_0_8_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_10_io_r = io_r_0_0[10]; // @[roundRobin.scala 229:22]
  assign units_0_10_io_wi = units_0_9_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_11_io_r = io_r_0_0[11]; // @[roundRobin.scala 229:22]
  assign units_0_11_io_wi = units_0_10_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_12_io_r = io_r_0_0[12]; // @[roundRobin.scala 229:22]
  assign units_0_12_io_wi = units_0_11_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_13_io_r = io_r_0_0[13]; // @[roundRobin.scala 229:22]
  assign units_0_13_io_wi = units_0_12_io_eo; // @[roundRobin.scala 214:25]
  assign units_0_14_io_r = io_r_0_0[14]; // @[roundRobin.scala 229:22]
  assign units_0_14_io_wi = units_0_13_io_eo; // @[roundRobin.scala 214:25]
endmodule
module RoundRobin(
  input  [7:0] io_r_0_0,
  output [7:0] io_g_0_0
);
  wire [14:0] sels_io_r_0_0; // @[roundRobin.scala 256:16]
  wire [14:0] sels_io_g_0_0; // @[roundRobin.scala 256:16]
  wire [7:0] _T_5 = {1'h0,sels_io_g_0_0[14:8]}; // @[Cat.scala 29:58]
  StrictPriority sels ( // @[roundRobin.scala 256:16]
    .io_r_0_0(sels_io_r_0_0),
    .io_g_0_0(sels_io_g_0_0)
  );
  assign io_g_0_0 = _T_5 | sels_io_g_0_0[7:0]; // @[roundRobin.scala 259:58 roundRobin.scala 285:60]
  assign sels_io_r_0_0 = {io_r_0_0[6:0],io_r_0_0}; // @[roundRobin.scala 278:66]
endmodule
module RoundRobinExample_Anon(
  input        clock,
  input        reset,
  input  [7:0] io_r,
  input  [2:0] io_p,
  output [7:0] io_g
);
  wire [7:0] RoundRobin_io_r_0_0; // @[roundRobin.scala 391:20]
  wire [7:0] RoundRobin_io_g_0_0; // @[roundRobin.scala 391:20]
  RoundRobin RoundRobin ( // @[roundRobin.scala 391:20]
    .io_r_0_0(RoundRobin_io_r_0_0),
    .io_g_0_0(RoundRobin_io_g_0_0)
  );
  assign io_g = RoundRobin_io_g_0_0; // @[roundRobin.scala 728:14]
  assign RoundRobin_io_r_0_0 = io_r; // @[roundRobin.scala 392:13]
endmodule
